<template>
	<view class="treasure-item" @click="gotoDetails()">
		<image class="treasure-icon" :src="datasource.cart_info.productInfo.image" mode=""></image>
		<text class="treasure-title line2">{{datasource.cart_info.productInfo.store_name}}</text>
	</view>
</template>

<script>
	export default {
		props: {
			datasource: {
				tyep: Object,
				default: () => {}
			},
			isSelect: {
				type: Boolean,
				default: false
			}
		},
		methods: {
			gotoDetails() {
				if (!this.isSelect) {
					uni.navigateTo({
						url: '/pages/treasure_details/index'
					})
				}else{
					this.$emit("selectTreasure")
				}
			},
		}
	}
</script>

<style lang="scss">
	.treasure-item {
		width: 330upx;
		height: 454upx;
		background-color: #fff;
		border-radius: 16upx;
		display: flex;
		flex-direction: column;
		overflow: hidden;
		box-shadow: 0px 0px 20px 0px rgba(0, 23, 46, 0.03);
		box-sizing: border-box;

		.treasure-icon {
			width: 100%;
			height: 330upx;
			background-color: green;
		}

		.treasure-title {
			margin: 20upx 20upx 0;
			color: #111111;
			line-height: 42upx;
		}
	}
</style>
